package com.sachin.coherence;

import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

import com.tangosol.net.CacheFactory;
import com.tangosol.net.NamedCache;

public class CoherenceApp {

	private Executor executer = Executors.newCachedThreadPool();

	public boolean runCoherence() {
		executer.execute(new CoherenceSwitch());
		return true;
	}

	public NamedCache createCache(String cacheName) throws RuntimeException {
		return CacheFactory.getCache(cacheName);
	}

	public void shutdown() {
		executer.execute(new CoherenceSwitch());

	}
}
